package com.youdu.vuandroidadsdk;

import android.support.test.runner.AndroidJUnit4;

import com.youdu.vuandroidadsdk.okhttp.CommonHttpClient;
import com.youdu.vuandroidadsdk.okhttp.listener.DisposeDataHandle;
import com.youdu.vuandroidadsdk.okhttp.listener.DisposeDataListener;
import com.youdu.vuandroidadsdk.okhttp.request.CommonRequest;
import com.youdu.vuandroidadsdk.okhttp.response.CommonJsonCallback;

import org.junit.Test;
import org.junit.runner.RunWith;

/**
 * Instrumentation test, which will execute on an Android device.
 *
 * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        CommonHttpClient.sendRequest(CommonRequest.createGetRequest("https://coding.imooc.com/lesson/84.html#mid=2316", null),
                new CommonJsonCallback(new DisposeDataHandle(new DisposeDataListener() {
                    @Override
                    public void onSuccess(Object responseObj) {
                        System.out.println("成功返回="+responseObj.toString());
                    }

                    @Override
                    public void onFailure(Object reasonObj) {
                        System.out.println("失败返回="+reasonObj.toString());
                    }
                })));
    }
}
